﻿using CSharpDay14.Data.Model;
using CSharpDay14__Adapters_and_Interfaces_.Adapters.Adapters;
using CSharpDay14__Adapters_and_Interfaces_.Adapters.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CSharpDay14__Adapters_and_Interfaces_.Controllers
{
    public class HomeController : Controller
    {
        private IUsersAdapter _adapter;

        public HomeController()
        {
            _adapter = new UsersAdapter();
        }

        public HomeController(IUsersAdapter a)
        {
            _adapter = a;
        }

        public ActionResult Index()
        {
            List<User> model = _adapter.GetAllUsers();
            return View(model);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}